//
//  PersonLikeScreen.m
//  ZooNgonDoiOS
//
//  Created by Trung sound on 6/7/12.
//  Copyright (c) 2012 Personal. All rights reserved.
//

#import "PersonLikeScreen.h"

@implementation PersonLikeScreen
#define IMAGE_VIEW_HEIGHT 65
#define IMAGE_VIEW_WIDTH 75
#define ARRAY_CAPACITY 8

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        _arrayView = [[NSMutableArray alloc]initWithCapacity:ARRAY_CAPACITY];
        _contentViewSize = CGSizeMake(ARRAY_CAPACITY * IMAGE_VIEW_WIDTH, IMAGE_VIEW_HEIGHT);
        
        if (_contentViewSize.width < self.bounds.size.width) {
            _contentViewSize.width = self.bounds.size.width;
        }
        
        [self setContentSize:_contentViewSize];
        self.backgroundColor = [UIColor lightGrayColor];

        for (int i=0; i<ARRAY_CAPACITY; i++) {
            _vPersonlike = [[UIView alloc]initWithFrame:CGRectMake(75*i, 0, 75, 65)];
            _vImage = [[UIView alloc]initWithFrame:CGRectMake(5, 0, 65, 65)];
            _personlike_img = [UIImage imageNamed:IMG_PERSONLIKE];
            _vImage.backgroundColor = [UIColor colorWithPatternImage:_personlike_img];
            [_vPersonlike addSubview:_vImage];
            [self addSubview:_vPersonlike];
//            [_vPersonlike release]; [_personlike_img release];
        }
        
        self.showsHorizontalScrollIndicator = NO;
    }
    return self;   
}
@end
